"""
异常类

@File: __init__.py.py
"""


class BusinessException(Exception):
    """
    业务异常
    """
    pass


class ParseException(Exception):
    """
    解析过程出现异常
    """

    def __init__(self, msg):
        super().__init__(msg)


class TokenVerifyException(Exception):
    """Token认证异常，当前端请求中所给的token不存在与Redis时抛出此异常"""

    def __init__(self, msg: str = ''):
        self.msg = 'token verify error. ' + msg


class RolePermissionError(Exception):
    """用户的角色权限错误"""
    pass
